Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for bug #3214 which had noted there was no request rate limit to - WIP #3261

Merged

Conversation

johnpinto1
Copy link
Contributor

@johnpinto1 johnpinto1 commented Dec 8, 2022

resetting the password.

DO NOT MERGE: PR CREATED FOR DISCUSSION

The Rack-Attack middleware for blocking & throttling abusive requests is being used.
https://github.com/rack/rack-attack/blob/6-stable/README.md

Fixes #3214

Changes:

  • Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
  • Added config/initializers/rack_attack.rb:
    • The rack-attack functionality is enabled with
      Rack::Attack.enabled = true
      but may be switched off
      Rack::Attack.enabled = false.
    • Password reset requests are currently throttled from an IP address for POSTs to path /users/passwords and is limited 2 requests every 30 seconds.
    • Login requests are throttled from an IP address for POSTs to path /users/sign_in and is limited 4 requests every 30 seconds.
    • A new html page public/429.html with title "Too Many Request" is added.

Selection_036

@johnpinto1 johnpinto1 force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch from 8497198 to cbff267 Compare December 8, 2022 13:32
@johnpinto1 johnpinto1 force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch 2 times, most recently from 94ef895 to d809377 Compare December 19, 2022 12:24
resetting the password.

The Rack-Attack middleware for blocking & throttling abusive requests is
being used.
https://github.com/rack/rack-attack/blob/6-stable/README.md

Changes:
- Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
- Added config/initializers/rack_attack.rb:
  - The rack-attack functionality is enabled with
        Rack::Attack.enabled = true
    but may be switched off
        Rack::Attack.enabled = false.
  - Password reset requests are currently throttled from from an IP address
    for POSTs to path /users/passwords and is limited 2 requests every 30 seconds.
ess
  - Login requests are throttled  from an IP address
    for POSTs to path /users/sign_in and is limited 4 requests every 30 seconds.  - A new html page public/429.html with title "Too Many Request" is added.
@johnpinto1 johnpinto1 force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch from d809377 to 71c9e55 Compare January 10, 2023 15:01
@briri briri changed the title Fix for bug #3214 which had noted there was no request rate limit to Fix for bug #3214 which had noted there was no request rate limit to - WIP Jan 23, 2023
@briri
Copy link
Contributor

briri commented Mar 23, 2023

@johnpinto1 I have rebased this against the latest development branch (which is now on Ruby 3.0.4).

Did you want to make any further changes to this before it gets merged in?

@johnpinto1
Copy link
Contributor Author

@johnpinto1 I have rebased this against the latest development branch (which is now on Ruby 3.0.4).

Did you want to make any further changes to this before it gets merged in?

@briri go ahead and merge.
@martaribeiro & @gjacob24 we can use the commit to patch our Ruby 2.7 our repo.

@briri briri merged commit 5ac38d3 into development Mar 24, 2023
@briri briri deleted the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch March 24, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants